import request from '@/utils/request'

// 查询店铺管理列表
export function listStoreMgmt(query) {
  return request({
    url: '/business/storeMgmt/list',
    method: 'get',
    params: query
  })
}

// 字段重复检查
export function getDoesItExist(query) {
  return request({
    url: '/business/storeMgmt/getDoesItExist',
    method: 'get',
    params: query
  })
}

// 查询店铺管理详细
export function getStoreMgmt(id) {
  return request({
    url: '/business/storeMgmt/' + id,
    method: 'get'
  })
}

// 新增店铺管理
export function addStoreMgmt(data) {
  return request({
    url: '/business/storeMgmt',
    method: 'post',
    data: data
  })
}

// 修改店铺管理
export function updateStoreMgmt(data) {
  return request({
    url: '/business/storeMgmt',
    method: 'put',
    data: data
  })
}

// 删除店铺管理
export function delStoreMgmt(id) {
  return request({
    url: '/business/storeMgmt/' + id,
    method: 'delete'
  })
}


// 导出文件
export function exportExcel(data){
  return request({
    url: '/business/storeMgmt/export',
    method: 'post',
    data: data
  })
}

// 状态变更
export function updateChangeStatus(ids, status){
  return request({
    url: '/business/storeMgmt/changeStatus',
    method: 'put',
    params: {
      ids: ids,
      status: status
    }
  })
}

// 店铺select
export function getNormalStoreMgmtList(query){
  return request({
    url: '/business/storeMgmt/getNormalStoreMgmtList',
    method: 'get',
    params: query
  })
}

// 产品梯队看板
export function getProductEchelon(query){
  return request({
    url: '/business/bulletinBoard/getProductEchelon',
    method: 'get',
    params: query
  })
}

// 产品梯队日期看板
export function getProductMonthEchelon(query){
  return request({
    url: '/business/bulletinBoard/getProductMonthEchelon',
    method: 'get',
    params: query
  })
}

// 刷新缓存
export function refreshCache() {
  return request({
    url: '/business/storeMgmt/refreshCache',
    method: 'delete'
  })
}

// 获取店铺负责人列表
export function getStoreLeaderList(){
  return request({
    url: '/business/storeMgmt/getStoreLeaderList',
    method: 'get'
  })
}
